#ifndef MyContactListener_H
#define MyContactListener_H
#include "Util.h"

class CContact
{
public:
	b2Fixture *fixtureA, *fixtureB;
	bool operator==(const CContact& other) const
	{
		return (fixtureA == other.fixtureA) && (fixtureB == other.fixtureB);
	}
};


class CContactListener : public b2ContactListener
{

public:
	virtual void BeginContact(b2Contact* contact);
	virtual void EndContact(b2Contact* contact);
	virtual void PreSolve(b2Contact* contact, const b2Manifold* oldManifold);
	virtual void PostSolve(b2Contact* contact, const b2ContactImpulse* impulse);

	void HandleCollision(CContact& myContact);

	std::vector<CContact> _contacts;

	CContactListener();
	~CContactListener();
};


#endif